﻿#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>


#define false 0
#define true 1

/*

*/
void reverseOrder(char* str, int p, int q)
{
	char temp;
	while(p < q)
	{
		temp = str[p];
		str[p] = str[q];
		str[q] = temp;
		p ++;
		q --;
	}
}

char* multiLargeNum(char* A, char* B)
{
	int m = strlen(A);
	int n = strlen(B);
	int index=0;
	char* result = new char[m+n+1];
	memset(result, '0', m+n);
	result[m+n] = '\0';
	if(A==B)
	{
		reverseOrder(A, 0, m-1);
	}
	else
	{
	reverseOrder(A, 0, m-1);
	reverseOrder(B, 0, n-1);
	}

	int multiFlag; 
	int addFlag;   
	for(int i=0; i <= n-1; i++) 
	{
		multiFlag = 0;
		addFlag = 0;
		for(int j=0; j <= m-1; j++) 
		{
			// '0' - 48 = 0
			int temp1 = (A[j] - 48) * (B[i] - 48) + multiFlag;
			multiFlag = temp1 / 10;
			temp1 = temp1 % 10;
			int temp2 = (result[i+j] - 48) + temp1 + addFlag;
			addFlag = temp2 / 10;
			result[i+j] = temp2 % 10 + 48; 
		}
		result[i + m] += multiFlag + addFlag;
	}
	reverseOrder(result, 0, m+n-1); 

	if(result[0]=='0')
	{
		for(int i=0;i<strlen(result);i++)
		{
			if(result[i]=='0')
			{
				index++;
			}
			else
				break;
		}

		for(int i=0;i<strlen(result)-index;i++)
		{
			result[i]=result[i+index];
		}

		result[strlen(result)-index]='\0';
	}


	if(A==B)
	{
		reverseOrder(A, 0, m-1);
	}
	else
	{
	reverseOrder(A, 0, m-1);
	reverseOrder(B, 0, n-1);
	}
	return result;
}

//#define MultiMain main

int MultiMain(int argc,char **argv) 
{ 

#ifdef FILEIO
	freopen("in.txt","r",stdin); 
	freopen("out.txt","w",stdout); 
#endif
#define SIZE 16
	char *s = (char*)malloc(sizeof(char)*SIZE);
	char *t = (char*)malloc(sizeof(char)*SIZE);
	int n;
	int a[SIZE];

	int i,j,k;
	int index;

	while(1) 
	{
		// get . position
		memset(s,0,sizeof(char)*SIZE);
		memset(t,0,sizeof(char)*SIZE);
		if(scanf("%s%d",s,&n) != 2)
		{
			break;
		}

		if(n==0)
		{
			printf("1\n");
			continue;
		}

		index = 0; 
		int len = strlen(s);

		for(i = len-1;i>=0;i--)
		{
			if(s[i] == '.') 
			{
				index = len-i-1; 
				for(j=i;j<len;j++)
				{
					s[j]=s[j+1]; //delete '.'
				}
				s[len-1]='\0';
				break;
			}
		}
		//reverseOrder(s,0,strlen(s)-1);
		int state = 0; //igore 0;
		int j=0;
		for(i = 0;i<len;i++)
		{
			if(state == 0)
			{
				if(s[i]=='0')
					continue;
				else
					state = 1;
			}

			if(state == 1)
			{
				t[j++] = s[i];
			}
		}
		t[j]='\0';

		if(strcmp(t,"")==0)
		{
			printf("0\n");
			continue;
		}

		char *result;

		if(n==1)
		{
			result = t;
		}
		else if(n>=2)
		{
			result = multiLargeNum(t,t);
			for(j=0;j<n-2;j++)
			{
				result = multiLargeNum(result,t);
			}
		}
		len = strlen(result);
		bool isAfterPot=false;
		int anchor=-1;
		if(result[len-1]=='0')
		{
			for(int i=len-1;i>=0;i--)
			{
				if(result[i]=='0')
				{
					anchor=i;
				}
				else
					break;
			}
		}
		if(index*n>=len)
		{
			isAfterPot=true;
			printf(".");
			for(i=0;i<index*n-len;i++)
			{
				printf("0");
			}
			for(j=0;j<len;j++)
			{
				if((anchor<0)||(anchor>0 && j < anchor))
				printf("%c",result[j]);
			}
		}
		else
		{
			int position = len - index*n -1;
			for(j=0;j<len;j++)
			{
				if(isAfterPot == false)
				{
					printf("%c",result[j]);

					if(j==position )
				{
						if((anchor<0) || (anchor>0 &&position<anchor-1))
					{
							printf(".");
						}
						isAfterPot = true;
					}
				}
				else
				{
					if((anchor<0)||(anchor>0 && j < anchor))
						printf("%c",result[j]);
				}
			}
		}
		printf("\n");
//		free(result);
	}




#ifdef FILEIO
	fclose(stdin);
	fclose(stdout);
#endif

	return 0; 
} 
